<?php
/**
 *
 * Created by PhpStorm
 * User: kalvin
 * DateTime: 2021/6/4 4:27 下午
 *
 */


namespace App\Entity;


use App\Models\User;
use Illuminate\Database\Eloquent\Collection;
use Ramsey\Uuid\Uuid;

class UserEntity
{
    public function getUserInfo(int $id1, int $id2) : Collection
    {
        $user = new User();
        $userData = $user
            ->where('id1', '=', $id1)
            ->where('id2', '=', $id2)->get();
        return $userData;
    }

    public function createUserInfo(int $id1, int $id2) : Collection
    {
        $user = new User();
        $user->id1 = $id1;
        $user->id2 = $id2;
        $user->user_id = Uuid::uuid4();
        $user->save();
        return $user;
    }
}
